package com.dk.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118651781";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCRxOgZkpO5kZy7aAilCEzeQ4NXpRa68JZjt8hcSJN0ZfjVdEBU7g7T7yoJe2fe0SkiWT94XK/VAh8Fwo+UxtDrFp9aOdOIKysENun73bHoiPKC7UNd7KMMeFkW+Z6652yjTJBzdhHv4kSwHjD1ETjONl78L0doh1GnShnb9XEi1Nbe/2GhAQ0zd6BLGbTCJfXomVNH/Sx8mZlc2yJPKlIO6RVv6017+sqEizit+IbSBL4GVIKblMRw69mBiK4mBz4/Qos9gFtceMczi9gwoEyv5E8tHngPdCopUC5SAXkw8QzlwIDWdoNBONN5eQOdre1wipW3L5KSQtXKH3VAAUpZAgMBAAECggEBAIaTGxRA1lEDtYbuzMxPlWe9PIy1xP5hDvaQvVE1T6yuV8P4x0uhW98dddm7LHHw9+DWNFqSd2JXyvwuWxAnXMks4YES0c9syxHhALOeQJlFlV56XS9hQEZK9TTYz0oOTaWVEecGohis9G0D8n7Nn3wBhj+cBnjiNOgU6TrApepY39h6JGuza6+ylzPBRv2I3cPx9o/zZz8PNutGoNKPWyPnPDSEhNAkFfByEWk06L3KAFKeDp12yIFY5OmGF2/kaGO2tR7o1KVKd/5qiXB9b5a9kIPKXUnP9+U1m5MmJTPNNBeQPIYkVvI2N91NAW4cN5oCRpJmNSgMndGyDJAaKGECgYEAyifqgqpgL+oNG/3OIWvPo4iPkQwV+1ebxy1yU5+lNag0vBq04aIa6GmMAO7CRK8IJvWKau5EhJWPUArb5HJFmLRVccWGEaLAYx6u2HCC5pCOuEcgtRGqlXMI4d6Dba5PQxrJTFs53es0ecggMDuuxUN2I/bsSTLRAa01YESLN2sCgYEAuJg8lsXI8bfoEUGU2NWTgb5PCXphSelbJrq+BZVr7+A/ByGw+5813ijoqp3YDF9/QVcibuQXmEUZjqHag4qua1Jm884H0AMtJcuryH7+fpPaydXd8GYnzy5ipTM0sVQLqxsADl/QyAmQaKOeFg1Zrckdphh8qZzoLHdKscMBqksCgYEAnoPQKmdohwmy/9jzkldUeLnzQVxFvFFFEFh9hj7vr/RWbY1PeoG/MbDZnD2bzXmmHc55nEF7Lq+LscriA+7qzcPSICUvbJK+4rpDheorapm9n5f+eJ0Csq+CLoJpck61TjwpzhrWdEIjYr7fJpMWBw5QDAFp5DfZlcP4z6TPuUMCgYEAhMhNXQ8sumNVtYP9M/R9xKhGZkT30pjfjn5pzc5r9ALUk6ayjm057HJ02rXsAQp4mWG6TRYZutiJx8W5T0HksSJ3GA0uJX0DbtqQ2QowupBUozcKDLEPFcMCBl9NGfmg4xXq9mwJ3Lq0e/Cl+KrlxVKT1zRqB//sKoAs5K2ndv0CgYBRPuM9pSyhuEGdNm7hol764kpg44DMBYnFdrXESegTdFK9f/3u0Nwj5xHAHGPQKJvW9mcuBHHlQv0px1GraKavs2g5fxDAYEtFqsYoHWArQC/zXUuiBBr1Oa5xQgVunK5CESkKKC7bYileuQTTPZcKHBOw0rQARX6w8TdnHstAqQ==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnhav0geKNapTv0w+3PoFsMQ4kYNiOIzBi1IZQKiOdION0I0NqTf7zAOua83PV6fYCE2sraA9TXHX857hOOuOj9ijZTfzXquuDCI2srA7q2I5pm+fCQlOImhgjpr1A7/ixApu8LOrpQCzUxQMFu8AKSf1hlCB2FBGnYQlkKmoPqGY/OPGuI1gzbDL31miEMbQdmVcUK0u4eYebmNGyopQ2KW/9WSnU5+zZDS43MeyrL+K8KAPTHqmf6rk4ZMIJGoQ5D2Ia4oL3dv7WDvUwJgmpp4kIVcgLlXzQjwl+ylN4V4Fo8UDOi74qC/SO4rbe9/QfBkjHkcrAG+Um04qMgfvxQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://45658oq243.qicp.vip/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://45658oq243.qicp.vip/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 日志网关
    public static String log_path = "E:\\logs";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
